{include file="common/mainHead"/}
<div class="admin-main fadeInUp animated">
    <blockquote class="layui-elem-quote">
        <a href="javascript:void(0);" onclick="remove()" class="layui-btn layui-btn-small">
            隐藏删除
        </a>
        <a href="javascript:void(0);" onclick="showcz()" class="layui-btn layui-btn-small">
            显示删除
        </a>
    </blockquote>
    <fieldset class="layui-elem-field">
        <legend>打印拍卖信息</legend>
        <div class="layui-field-box table-responsive">
            <form class="layui-form layui-form-pane">
                <div id="print">
                    <p style="text-align: center; font-size: 30px; padding-bottom: 15px;">商品竞价记录信息</p>
                     <table class="layui-table table-hover" >
                    <thead>
                    <tr>
                        <th>序号</th>
                        <th>用户名</th>
                        <th>手机号</th>
                        <th>竞价编号</th>
                        <th>出价</th>
                        <th>出价时间</th>
                        <th class="mycz">操作</th>
                    </tr>
                    </thead>
                    <!--内容容器-->
                    <tbody id="con">
                    {volist name="biddenlist" id="vo" }
                        <tr>
                            <td>{$i}</td>
                            <td>{$vo.username}</td>
                            <td>{$vo.phone}</td>
                            <td>{$vo.usernumber}</td>
                            <td>￥{$vo.price}</td>
                            <td>{$vo.cretime|date="y-m-d H:i:s",###}</td>
                            <td class="mycz"><a href="javascript:;" onclick="delBidden({$vo.id})" data-id="1" data-opt="del" class="layui-btn layui-btn-danger layui-btn-mini">删除</a></td>
                        </tr>
                    {/volist}
                    <tr>
                        <td colspan="6" style="text-align: center;">拍品名称：<u>{$goods_info['title']} </u><span style="display: inline-block;width: 50px;"></span> 拍卖开始时间：<u>{$goods_info['starttime']|date="Y年m月d日 H时i分",###}</u></td>
                    </tr>
                    <tr>
                        <td colspan="6" style="text-align: center;">起拍价：<u>{$goods_info['start_price']}</u>元  <span style="display: inline-block;width: 50px;"></span> 保留价：<u>{$goods_info['end_price']}</u> 元  <span style="display: inline-block;width: 50px;"></span> 最高价：<u>{$maxgoods_info['price']}</u>元 </td>
                    </tr>
                    <tr>
                        <td colspan="6" style="text-align: center;"> 拍卖企业：<u> {$goods_info['acut_company']}</u> <span style="display: inline-block;width: 50px;"></span>联系电话：<u>{$goods_info['phone']}</u></td>
                    </tr>
                    <tr>
                        <td colspan="6" style="text-align: center;">
                            本出《商品竞价记录信息》由“价高得竞价软件提供”
                        </td>
                    </tr> 
                   </tbody>
                    <tfoot>
                    <tr>
                        <td colspan="8">
                            <!--分页容器-->
                            <div id="paged" style="text-align: right"></div>
                        </td>
                    </tr>
                    </tfoot>
                </table>
                </div>
            </form>
            <button type="button" onclick="aa()" class="layui-btn" >打印</button>
            <button type="button" style="display: <?php if($userinfo['level'] == 1 || $goods_info['is_sure'] ==1 ||$goods_info['is_end'] == 0) echo 'none'; ?>" onclick="cc({$userinfo['user_id']},{$goods_info['id']},{$maxgoods_info['price']},'{$maxgoods_info['username']}');" class="layui-btn" >给pc用户发送成交消息</button>
            <button type="button" style="display: <?php if($userinfo['level'] != 1 || $goods_info['is_sure'] ==1 ||$goods_info['is_end'] == 0) echo 'none'; ?>" onclick="bb({$userinfo['user_id']},{$goods_info['id']},{$maxgoods_info['price']},'{$maxgoods_info['username']}');" class="layui-btn" >给微信用户发送成交消息</button>
            <a href="{:url('WebGoods/detailGood')}?id={$goods_info['id']}" class="layui-btn">返回</a>
        </div>
    </fieldset>
</div>
{include file="common/mainFoot"/}
<script>
    function aa(){
        //$('title').text('商品竞价记录信息');
        $("#print").jqprint();
    }
    function bb(userid,goodsid,maxprice,username){
        window.location.href="{:url('Wechat/sendUser')}"+"?userid="+userid+"&goodsid="+goodsid+"&maxprice="+maxprice+"&username="+username;
    }
    function cc(userid,goodsid,maxprice,username) {
        alert('功能等待开发中');
    }

    function delBidden(id) {
        //alert('删除'+id);
        $.post("{:url('WebBidden/delBidden')}",{id:id},function(data){
            data=JSON.parse(data);
            if(data.status=='ok'){
                alert('删除成功');
                window.location.reload();
            }
            else
                alert('删除失败');
        },"json");
    }

    function remove() {
        $('.mycz').hide();
    }
    function showcz() {
        $('.mycz').show();
    }
</script>
